
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@alwatr/observable
Advanced tools
A lightweight and flexible TypeScript library for implementing the observer pattern (similar to signals) with events, subscriptions, and convenient features.
A lightweight and flexible TypeScript library for implementing the observer pattern (similar to signals) with events, subscriptions, and convenient features.
once
, priority
, and receivePrevious
.npm install @alwatr/observable
AlwatrObservable
constructor(config: {name: string; loggerPrefix?: string})
: Creates a new AlwatrObservable
instance.
config.name
: The name of the signal (used for logging).config.loggerPrefix
: Optional prefix for log messages.subscribe(listenerCallback: ListenerCallback<this, T>, options: SubscribeOptions = {}): SubscribeResult
: Subscribes to the signal.
listenerCallback
: The function to be called when an event is emitted.options
:
once
: If true
, the listener will be automatically unsubscribed after the first event.priority
: If true
, the listener will be executed before other listeners.receivePrevious
: If true
, the listener will be immediately called with the last emitted event (if available).disabled
: If true
, the listener will not be executed.unsubscribe(listenerCallback: ListenerCallback<this, T>)
: Unsubscribes a listener from the signal.
notify_(message: T)
: Emits an event to all subscribers.
message
: The data to be sent to the subscribers.clearMessage_()
: Clears the current message without notifying subscribers.
untilNewNotify_()
: Returns a Promise that resolves with the next emitted event.
The following companies, organizations, and individuals support flux ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
Contributions are welcome! Please read our contribution guidelines before submitting a pull request.
This project is licensed under the AGPL-3.0 License.
3.2.2 (2024-11-02)
FAQs
A lightweight and flexible TypeScript library for implementing the observer pattern (similar to signals) with events, subscriptions, and convenient features.
We found that @alwatr/observable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.